#include <EEPROM.h>

void setup() {
  Serial.begin(9600);
  Serial.println("EEPROM Migra v1");

  byte            ipAddress[4];
  byte            macAddress[6];
  
  delay(5000);

  Serial.println(" ");
  Serial.println("Before");
  for (int i = 0; i <= 9; i++) {

      Serial.print(i);
      Serial.print(" = ");
      int v = EEPROM.read(i);
      Serial.println(v);
  }

  for (int i = 0; i <= 9; i++) {
    if (i<=3) {
      ipAddress[i] = EEPROM.read(i);
    } else {
      macAddress[i-4] = EEPROM.read(i);
    }
  }

  EEPROM.write( 0, ipAddress[0]);
  EEPROM.write( 1, ipAddress[1]);
  EEPROM.write( 2, ipAddress[2]);
  EEPROM.write( 3, 200);
  EEPROM.write( 4, ipAddress[3]-200);

  EEPROM.write( 5, macAddress[0]);
  EEPROM.write( 6, macAddress[1]);
  EEPROM.write( 7, macAddress[2]);
  EEPROM.write( 8, macAddress[3]);
  EEPROM.write( 9, macAddress[4]);
  EEPROM.write(10, macAddress[5]);

  Serial.println(" ");
  Serial.println("After");
  for (int i = 0; i <= 10; i++) {

      Serial.print(i);
      Serial.print(" = ");
      int v = EEPROM.read(i);
      Serial.println(v);
  }

}

void loop() {
  
}
